package org.future.persistent.db;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
// 
// library dependencies:
//  * commons-dbcp-1.3.jar   [http://commons.apache.org/dbcp/download_dbcp.cgi]
//  * commons-pool-1.5.4.jar [http://commons.apache.org/pool/download_pool.cgi]
// 
/**
 * @author  
 * @date    2010-6-18
 * @file    org.demo.dao.Main.java
 */
public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args)throws Exception{
		// get connection
		Connection conn = ConnectionTools.getConnection();
		// execute business operations
		Statement stmt = null;
		ResultSet rset = null;
		stmt = conn.createStatement();
		rset = stmt.executeQuery("select 1 from dual");
		int cols = rset.getMetaData().getColumnCount();
		while(rset.next()){
			for(int i=1;i<=cols;i++){
				System.out.print("\t" + rset.getObject(i));
			}
			System.out.println("");
		}
		// close connection
		ConnectionTools.close(rset, stmt, conn);
	}

}
